package lesson3;

import java.io.File;

public class Demo2 {
    public static void main(String[] args) {
        File fileDir = new File("C:\\Users\\Administrator\\Desktop\\TestFile");
        //遍历文件夹
        //String[] files = fileDir.list();
        File[] files = fileDir.listFiles();
        System.out.println("------------");
//        for(int i = 0; i < files.length;i++){
//            System.out.println(files[i].getAbsolutePath());
//        }
        for(File file:files){
            System.out.println(file.getAbsolutePath());
        }
    }
}
